//
//  PlaylistTableViewCell.m
//  MusicPlayer-two
//
//  Created by lanou3g on 15/8/21.
//  Copyright (c) 2015年 大展宏图. All rights reserved.
//


#import "PlaylistTableViewCell.h"
#import "UIImageView+WebCache.h"

@implementation PlaylistTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self drawView];
        
    }
    return self;
}

- (void)drawView{
    
    CGFloat w = ([UIScreen mainScreen].bounds.size.width - 20) / 6.0 ;
    
    self.singerImage = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, w, w)];
//    self.singerImage.backgroundColor = [UIColor redColor];
//    self.singerImage.layer.cornerRadius = 25 ;
    [self.contentView addSubview:_singerImage];
    
    self.singerNameLabel  = [[UILabel alloc] initWithFrame:CGRectMake(w + 10, 5,200 , w /2)];
    self.singerNameLabel.textColor = [UIColor whiteColor];
    self.singerNameLabel.font = [UIFont boldSystemFontOfSize:18];
    [self.contentView addSubview:_singerNameLabel];
    
    self.NameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.singerNameLabel.frame.origin.x  , _singerNameLabel.frame.size.height +5, 200, w / 2  )];
    self.NameLabel.textColor = [UIColor whiteColor];
    self.NameLabel.font = [UIFont boldSystemFontOfSize:15];
    [self.contentView addSubview:_NameLabel];
    
    
}

+ (CGFloat)setWithHight{
    CGFloat Hight = ([UIScreen mainScreen].bounds.size.width - 20) / 6.0 ;
    return Hight + 10;
}

- (void)setCellWithMusicInfo:(MusicInfo *)musicInfo{
    
    self.NameLabel.text = musicInfo.singer;
    self.singerNameLabel.text = musicInfo.name;
    [self.singerImage sd_setImageWithURL:[NSURL URLWithString:musicInfo.picUrl]];


}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
